# -*- encoding=utf8 -*-
__author__ = "Bryan.Chen"

from airtest.core.api import *

auto_setup(__file__)

from poco.drivers.std import StdPoco
poco = StdPoco()

using("../FlowTest.air")
import FlowTest

class Login_PopUpActivity(FlowTest.BaseTestCase):

    def __init__(self):
        print("%s __init__" % (__file__))
    
    def runTest(self, args):
        sleep(2.0)
        try:
            poco("HjLobbyScene").wait_for_appearance(120)
        except:
            stop_app("com.highlight.mjpe")
        
        popupActiveView = poco("PopupActiveView")
        if not popupActiveView:
            return True
        
        while popupActiveView.exists():
            popupActiveView.offspring("button_close").click([0.5, 0.5])
            popupActiveView = poco("PopupActiveView")
            
        return True
        
_instance = Login_PopUpActivity()
runTest = _instance.runTest

